<?php
/*
Template Name: 评论
*/
get_header();
$m = $_GET['m'];
$page = intval($_GET['page'])?intval($_GET['page']):1;
?>
<div id="content" class="content">
	<div id="innerContent">
	<div class="textbox">
			<div class="textbox_header"></div>
		<div class="textbox_inner">
		<?php if ($user = get_userdatabylogin($m)): $author=$user->ID; ?>
				<div class="textbox-title">
					<h1 class="pagetitle">
					<?php echo get_avatar(get_the_author_meta('user_email',$author),'50');?>
					评论/<?php the_author_meta('display_name',$author);?></h1>
					<h2 class="post_info"> 
						  <div class="post_info_left">
							<span>
							[发表 <a href="<?php echo get_author_posts_url($author); ?>" title="查看TA发表的文章"><?php echo get_usernumposts($author);?></a>篇]
							[评论<a href="<?php echo get_page_url('comment').'?m='.get_the_author_meta('user_login',$author); ?>" title="查看评论"><?php echo get_usernumcomments($author);?></a>条]
							<?php if(get_the_author_meta('user_url',$author)){?>
							[<a href="<?php the_author_meta('user_url',$author);?>" target="_blank">主页</a>]
							<?php }?>
							</span>
						  </div>
					</h2>
				</div>
				<div class="textbox-content article-content">
					<p>
					<?php if(get_the_author_meta('description',$author)){
						the_author_meta('description',$author);
					}?>
					</p>
				</div>
			<?php endif;?>
				</div>
			<div class="textbox_footer"></div>
		</div>	
		<div class="textbox">
					<div class="textbox_header"></div>
				<div class="textbox_inner">
		                <div class="textbox-title">
						 <?php walleve_comment_list($author,$user->user_login,$page); ?>
							</div>
						</div>
					<div class="textbox_footer"></div>
				</div>

				<div class="article-bottom" style="display: block">
					<div class="pages">
							<span class="pagebar-selections">
							<div id="pagenavi">
								<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
							</div>
							</span>
					</div>
				</div>
			
	</div>
</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>